<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>

<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>会员登录</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css"
        type="text/css"/>
  <script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js"
          type="text/javascript"></script>
  <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"
          type="text/javascript"></script>
  <!-- 引入自定义css文件 style.css -->
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css"/>
  <style>
    body {
      margin-top: 20px;
      margin: 0 auto;
    }

    .carousel-inner .item img {
      width: 100%;
      height: 300px;
    }

    .container .row div {
      /* position:relative;
       float:left; */
    }

    font {
      color: #3164af;
      font-size: 18px;
      font-weight: normal;
      padding: 0 10px;
    }
  </style>
</head>

<body>
<jsp:include page="head.jsp" />

<div class="container">
    <div class="row">
      <div style="margin:0 auto; margin-top:10px;width:950px;">
        <c:if test="${not empty collection}">
        <strong style="font-size:16px;margin:5px 0;">我的收藏</strong>
        <table class="table table-bordered">
          <tbody>
          <tr class="warning">
            <th>图片</th>
            <th>商品</th>
            <th>价格</th>
            <th>操作</th>
          </tr>
          <c:forEach items="${collection}" var="item">
            <tr class="active">
              <td width="60">
                <input type="hidden" name="pid" value="${item.pid}">
                <img src="${pageContext.request.contextPath}/${item.pimage}" width="70" height="60">
              </td>
              <td width="30%">
                <a href="${pageContext.request.contextPath}/product/getProductInfo.do?pid=${item.pid}">${item.pname }</a>
              </td>
              <td width="20%">
                ￥${item.shop_price }
              </td>
              <td width="20%">
                <a href="${pageContext.request.contextPath}/deleteCollection.do?pid=${item.pid}" onclick="return confirm('确认是否删除')">删除收藏</a>
              </td>
            </tr>
          </c:forEach>
          </tbody>
        </table>
      </div>
    </div>
</div>
</c:if>

  <c:if test="${empty collection}">
    <h1><img src="${pageContext.request.contextPath }/img/cry.png" width="120px" height="120px"><a href="${pageContext.request.contextPath}/index.do" style="color: #0f0f0f">没有收藏任何东西哦，快去看看有什么好东西吧！</a>
    </h1>
  </c:if>
</div>

<jsp:include page="foot.jsp" />

</body>


</html>